
package DTO;

/**
 *This class acts as data transfer abstraction for category object attributes. It encapsulates address attributes.
 * This object is transferred back and forth amongst various layers.
 * @author tejinder
 * @see DTO
 */
public class Category {

    private int ctid;
    private int pctid;
    private String name;

    /**
     * default constructor
     */
    public Category(){
        ctid = 0;
        pctid = 0;
        name = "";
    }

    /**
     * parameterized constructor
     * @param ctid integer category id
     * @param pctid integer parent category id
     * @param name string name
     */
    public Category(int ctid, int pctid, String name){
        this.ctid = ctid;
        this.pctid = pctid;
        this.name = name;
    }

    /**
     * gets category id
     * @return integer
     */
    public int getCtid() {
        return ctid;
    }

    /**
     * gets name
     * @return string
     */
    public String getName() {
        return name;
    }

    /**
     * gets parent category id
     * @return integer
     */
    public int getPctid() {
        return pctid;
    }

    /**
     * sets category id
     * @param  ctid
     */
    public void setCtid(int ctid) {
        this.ctid = ctid;
    }

    /**
     * sets name
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * sets parent category id 
     * @param pctid
     */
    public void setPctid(int pctid) {
        this.pctid = pctid;
    }

   /**
     * toString() method overrides the default behavior of Object class toString() method.
     * @return  a string representing the state of object
     */
    public String toString() {
        return name;
    }


}
